<template>
  <el-breadcrumb class="app-breadcrumb" separator="/">
    <transition-group name="breadcrumb">
      <el-breadcrumb-item v-for="(item,index) in levelList" :key="index">
        <span v-if="item.routeName">
          <router-link :to="{name: item.routeName}">{{ item.title }}</router-link>
        </span>
        <span v-else>{{ item.title }}</span>
      </el-breadcrumb-item>
    </transition-group>
  </el-breadcrumb>
</template>

<script>
export default {
  props: {
    breadList: {
      type: Array,
      default: function() {
        return []
      }
    }
  },
  data() {
    return {

    }
  },
  computed: {
    levelList() {
      // console.log('路由数组', this.$props.breadList)
      return this.$props.breadList || []
    }
  },
  created() {
    // this.getBreadcrumb()
  },
  methods: {}
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.app-breadcrumb.el-breadcrumb {
  display: inline-block;
  font-size: 14px;
  line-height: 50px;
  margin-left: 10px;
  .no-redirect {
    color: #97a8be;
    cursor: text;
  }
}
</style>
